﻿@using SmartStore.Web.Models.Checkout;
@using SmartStore.PayPal.Models;
@model PayPalPlusCheckoutModel
@{
    Layout = "_Checkout";
    Html.AddTitleParts(T("PageTitle.Checkout").Text);
}
@section orderProgress
{
	@{ Html.RenderAction("CheckoutProgress", "Checkout", new { step = CheckoutProgressStep.Payment }); }
}

@{ Html.RenderPartial("PaymentWallScripting"); }

<div id="PayPalPlusPage" class="page payment-method-page">
	<div class="page-title">
		<h1>@T("Checkout.SelectPaymentMethod")</h1>
	</div>
	<div class="page-body checkout-data">
		@{ Html.RenderWidget("checkout_payment_method_top"); }

		@if (Model.ErrorMessage.HasValue())
		{
			<div class="alert alert-danger">
				@Html.Raw(T("Plugins.Payments.PayPalPlus.MethodUnavailable"))
				<br />
				@if (!Model.ApprovalUrl.HasValue())
				{
					@T("Plugins.SmartStore.PayPal.NoApprovalUrlReturned")
				}
				@Model.ErrorMessage
			</div>
		}
		else if (Model.PayPalPlusPseudoMessageFlag.HasValue() && Model.PayPalPlusPseudoMessageFlag == "1")
		{
			<div class="alert alert-danger">
				@Html.Raw(T("Plugins.Payments.PayPalPlus.SorryFailure"))
			</div>
		}

		@if (Model.FullDescription.HasValue())
		{
			<div class="payment-method-description">
				@Html.Raw(Model.FullDescription)
			</div>
		}

		@if (Model.HasAnyFees)
		{
			<div id="PayPalPlusPaymentFeeContainer" class="alert alert-info payment-fee mb-0" style="visibility:hidden;">
				@T("Plugins.Payments.PayPalPlus.PaymentFeeMessage")
			</div>
		}

		<div id="PayPalPlusPaymentWall"></div>

		<div class="select-button buttons">
			<a class="btn btn-secondary btn-lg" href="@Url.Action("ShippingMethod", "Checkout", new { area = "" })">
                <i class="fa fa-angle-left"></i>
                <span>@T("Common.Back")</span>
			</a>

			<button id="PayPalPlusNextCheckoutStep" class="btn btn-warning btn-lg payment-method-next-step-button hide">
                <span>@T("Checkout.NextButton")</span>
                <i class="fa fa-angle-right"></i>
			</button>
		</div>

		@{ Html.RenderWidget("checkout_payment_method_bottom"); }
	</div>
</div>